home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / CBGRX103.ZIP / contrib / libgrx / fntool / writefna.c < prev    next >
Text File  |  1993-12-06  |  1KB  |  44 lines

  1. #include "fntool.h"
  2.  
  3. void writefna(void)
  4. {
  5.     int  xx,yy;
  6.     char *p;
  7.     chr  *cp;
  8.  
  9.     fprintf(outfile,"name %s\n",fnt.name);
  10.     fprintf(outfile,"family %s",fnt.family);
  11.     if(fnt.weight[0] != '\0') fprintf(outfile,"_%s",fnt.weight);
  12.     if(fnt.slant[0]  != '\0') fprintf(outfile,"_%s",fnt.slant);
  13.     fprintf(outfile,"\nminchar %d\n",fnt.minchar);
  14.     fprintf(outfile,"maxchar %d\n",fnt.maxchar);
  15.     fprintf(outfile,"isfixed %d\n",fnt.isfixed);
  16.     if(fnt.isfixed)
  17.         fprintf(outfile,"width %d\n",fnt.avgwidth);
  18.     else {
  19.         fprintf(outfile,"avgwidth %d\n",fnt.avgwidth);
  20.         fprintf(outfile,"minwidth %d\n",fnt.minwidth);
  21.         fprintf(outfile,"maxwidth %d\n",fnt.maxwidth);
  22.     }
  23.     fprintf(outfile,"height %d\n",fnt.height);
  24.     fprintf(outfile,"undwidth %d\n",fnt.undwidth);
  25.     fprintf(outfile,"baseline %d\n\n",fnt.baseline);
  26.     for(p = notes,xx = 0; *p != '\0'; p++) {
  27.         if(xx == 0) fputs("note ",outfile);
  28.         putc(*p,outfile);
  29.         xx++;
  30.         if(*p == '\n') xx = 0;
  31.     }
  32.     for(cp = fnt.chars; cp != NULL; cp = cp->next) {
  33.         fprintf(outfile,"\n; character %d ",cp->code);
  34.         if(isprint(cp->code)) fprintf(outfile,"(%c) ",cp->code);
  35.         fprintf(outfile,"width = %d\n",cp->width);
  36.         for(yy = 0; yy < fnt.height; yy++) {
  37.         for(xx = 0; xx < cp->width; xx++)
  38.             putc((cp->bmp[yy][xx] ? '#' : '.'),outfile);
  39.         putc('\n',outfile);
  40.         }
  41.     }
  42. }
  43.  
  44.